layui.use(['form','layer','flow'],function(){
    var form = layui.form
        layer = parent.layer === undefined ? layui.layer : top.layer,
        $ = layui.jquery,
        flow = layui.flow;

    $(function(){
    	let userId = parent.editId;
    	var lis = [],tmp="",num=1;
    	flow.load({
    	    elem: '#LAY_demo1' //流加载容器
    	   // ,scrollElem: '#LAY_demo1' //滚动条所在元素，一般不用填，此处只是演示需要。
    	    ,done: function(page, next){ //执行下一页的回调
    	    	ajaxRequest({
    	    		url:'/business/getWithdrawalData',
    	    		type:'post',
    	    		param:{userId:userId,pageNo:num++,pageSzie:10},
    	    		success:function(data){
    	    			console.log(data)
    	    			if(data != null && data.length>0){
    	    				for(var i = 0; i< data.length; i++){
        	    				if(data[i].status == 1)
        	    					tmp ='审核中'
        	    				else if(data[i].status == 2)tmp ='提现成功'
        	    				else if(data[i].status == 3)tmp ='提现失败'
        	    				lis.push("<tr><td>"+data[i].toName+"</td><td>"+data[i].transferId+"</td><td>"+data[i].amount+"</td><td>"+data[i].servicechargeAmount+"</td><td>"+tmp+"</td><td>"+data[i].createTime+"</td></tr>")
        	    			}
    	    					next(lis.join(''),data.length > 0); 
    	    			}else{
    	    				next(null,false);
    	    			}
    	    		
    	    		}
    	    	})
    	    	
    	    	
    	      //模拟数据插入
//    	      setTimeout(function(){
//    	        var lis = [];
//    	        for(var i = 0; i < 8; i++){
//    	          lis.push('<tr><td>贤心</td><td>汉族</td> <td>1989-10-14</td><td>人生似修行</td></tr>')
//    	        }
//    	        
//    	        //执行下一页渲染，第二参数为：满足“加载更多”的条件，即后面仍有分页
//    	        //pages为Ajax返回的总页数，只有当前页小于总页数的情况下，才会继续出现加载更多
//    	        next(lis.join(''), page < 10); //假设总页数为 10
//    	      }, 500);
    	    }
    	  });
    	/*ajaxRequest({
    		url:'/business/getUserInfo/'+userId,
    		type:'get',
    		success:function(data){
    			$(".nickName").val(data.nickName);
    			$(".phone").val(data.phone);
    			$(".role").val(data.role==0?'普通用户':'供应商');
    			$(".level").val(data.level);
    			$(".account").val(data.accountBalance);
    			$(".profit").val(data.profitBalance);
    			$(".frozen").val(data.profitBalance);
    			$(".recommon").val(data.recommonNumber);
    			$("#userFace").attr("src",data.headImage);
    			
    			ajaxRequest({
    				url:'/business/getUserInfo/'+data.fatherId,
    	    		type:'get',
    	    		success:function(data){
    	    			$(".father").val(data.phone);
    	    		}
    			});
    		}
    	})*/
    })
    
    
    

   

})